package itheima.com.Test;

import java.util.ArrayList;

public class MyStream02 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("张三丰");
        list.add("张无忌");
        list.add("张翠山");
        list.add("王二麻子");
        list.add("张良");
        list.add("谢广坤");

        //求集合长度
        long count = list.stream().count();
        System.out.println(count);

        list.stream().forEach(s-> System.out.println(s));
    }
}
